<?php

/**
 * Andromeda
 *
 * Plataforma de desenvolvimento de aplica��es  
 *
 * @package		Andromeda
 * @author		Roberto C�mara
 * @copyright	----
 * @Cr�ditos    CodeIgniter FrameWork && PHPpit Framework Tutorial
 * 				A metodologia e principios desta plataforma baseiam-se no
 *				conte�do intelectual open source introduzido pelas 
 *				identidades mencionadas.
 */

// ------------------------------------------------------------------------

/**
 * Classe Basedados
 *
 * Driver BD para mysql
 *
 * @package		Andromeda
 * @subpackage	classes
 * @category	DataBase
 * @author		Roberto C�mara
 */

Class Basedados
{
    private $registry;
	private $host;
	private $nomedb;
	private $username;
	private $password;
	private $db_link;
	
    function __construct($registry, $my_host, $my_nomedb, $my_username, $my_password) {
        $this->registry = $registry;
		
		$this->host = $my_host;
		$this->nomedb = $my_nomedb;
		$this->username = $my_username;
		$this->password = $my_password;
		
		$this->db_link = mysql_connect($my_host, $my_username, $my_password) or die(mysql_error());
		mysql_query('SET NAMES utf8');
    	if(Debug)
		{
			define ('MYSQL_SERVER_INFO', mysql_get_server_info($this->db_link));
			define ('MYSQL_INFO', mysql_info($this->db_link));
		}
		
		mysql_select_db($my_nomedb) or die(mysql_error());
		
    }
	
    function get_DBname(){
    	return $this->nomedb;
    }
	public function kill_db()
	{
		mysql_close($this->db_link);
	}
	
	/* Fun��es Padr�o */
}

?>